package b1.scenes.load
{
	import b1.controls.basic.*;
	import b1.utils.*;
	
	import flash.display.Sprite;
	import flash.filters.*;
	import flash.text.*;

	public class LoadingScene extends Sprite
	{
		public var loadBar:LoadProgressBar;
		
		public function LoadingScene(showText:String)
		{
			super();
			//黑色背景
			this.graphics.beginFill(0x000000);
			this.graphics.drawRect(0, 0, BFont.stageWidth, BFont.stageHeight);
			//进度条
			loadBar = new LoadProgressBar();
			loadBar.x = BFont.stageWidth / 2 - 50;
			loadBar.y = 2 * (BFont.stageHeight - loadBar.height) / 5;
			addChild(loadBar);
			//文字
			var loadText:TextField = new TextField();
        	loadText.autoSize = TextFieldAutoSize.CENTER;
			loadText.defaultTextFormat = new TextFormat("微软雅黑", 15, 0xFFFFFF);
			loadText.selectable = false;
			loadText.text = showText;
			loadText.x = (BFont.stageWidth - loadText.width) / 2;
			loadText.y = loadBar.y + 170;
			addChild(loadText);

			var gradientGlow:GradientGlowFilter = new GradientGlowFilter();
			gradientGlow.distance = 0;
			gradientGlow.angle = 45;
			gradientGlow.colors = [0xFFFFFF, 0xFFFF00];
			gradientGlow.alphas = [0, 1];
			gradientGlow.ratios = [0, 255];
			gradientGlow.blurX = 130;
			gradientGlow.blurY = 130;
			gradientGlow.strength = 2;
			gradientGlow.quality = BitmapFilterQuality.HIGH;
			gradientGlow.type = BitmapFilterType.OUTER;
			loadBar.filters = [gradientGlow];
		}
		
	}
}